home *** CD-ROM | disk | FTP | other *** search
/ Suzy B Software 2 / Suzy B Software CD-ROM 2 (1994).iso / extras / programm / gemfsc20 / gemfsc20.lzh / GNUGEM27 / GEMFAST.H < prev    next >
C/C++ Source or Header  |  1993-03-24  |  15KB  |  591 lines

  1. #ifndef _GEMFAST_H
  2. #define _GEMFAST_H
  3.  
  4. #ifndef _COMPILER_H
  5. # include <compiler.h>
  6. #endif
  7.  
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11.  
  12. /**************************************************************************
  13.  *
  14.  * GEMFAST.H - Header file for common VDI and AES symbols.
  15.  *
  16.  *    This header file contains items compatible with both GEMDEFS and OBDEFS
  17.  *    from the Alcyon system.  Note that there are no 'extern' definitions
  18.  *    for the functions, because they all return a signed short and work
  19.  *    fine as autodefined functions.
  20.  *
  21.  *    If you have a lot of source already coded for #include <gemdefs.h>,
  22.  *    you can continue to use your original gemdefs file, or you can rename
  23.  *    this file to gemdefs.h; if your source also includes obdefs.h, remove
  24.  *    them when using this file.
  25.  *    (i have links called obdefs and gemdefs, since this file is now protected
  26.  *     against multiple inclusions -- ++jrb)
  27.  *
  28.  * Credits dept:
  29.  *    This file bears an amazing similarity to the original Alcyon GEMDEFS
  30.  *    and OBDEFS header files, which are copyrighted by Atari.  What can I
  31.  *    say?  Copyrighted or not, these are the names and values that every-
  32.  *    body uses, so of course the files look *awful* similar...
  33.  *
  34.  *************************************************************************/
  35.  
  36.         /* evnt_multi flags */
  37. #define MU_KEYBD    0x0001
  38. #define MU_BUTTON    0x0002
  39. #define MU_M1        0x0004
  40. #define MU_M2        0x0008
  41. #define MU_MESAG    0x0010
  42. #define MU_TIMER    0x0020
  43.         /* keyboard states */
  44. #define K_RSHIFT    0x0001
  45. #define K_LSHIFT    0x0002
  46. #define K_CTRL        0x0004
  47. #define K_ALT        0x0008
  48.         /* event message values */
  49. #define MN_SELECTED 10
  50. #define WM_REDRAW    20
  51. #define WM_TOPPED    21
  52. #define WM_CLOSED    22
  53. #define WM_FULLED    23
  54. #define WM_ARROWED    24
  55. #define WM_HSLID    25
  56. #define WM_VSLID    26
  57. #define WM_SIZED    27
  58. #define WM_MOVED    28
  59. #define WM_NEWTOP    29
  60. #define AC_OPEN     40
  61. #define AC_CLOSE    41
  62.         /* Xcontrol messages */
  63. #define CT_UPDATE    50
  64. #define CT_MOVE     51
  65. #define CT_NEWTOP    52
  66. #define CT_KEY        53
  67.  
  68.         /* form_dial opcodes */
  69. #define FMD_START    0
  70. #define FMD_GROW    1
  71. #define FMD_SHRINK    2
  72. #define FMD_FINISH    3
  73.         /* rsrc_gaddr structure types */
  74. #define R_TREE        0
  75. #define R_OBJECT    1
  76. #define R_TEDINFO    2
  77. #define R_ICONBLK    3
  78. #define R_BITBLK    4
  79. #define R_STRING    5
  80. #define R_IMAGEDATA 6
  81. #define R_OBSPEC    7
  82. #define R_TEPTEXT    8
  83. #define R_TEPTMPLT    9
  84. #define R_TEPVALID    10
  85. #define R_IBPMASK    11
  86. #define R_IBPDATA    12
  87. #define R_IBPTEXT    13
  88. #define R_BIPDATA    14
  89. #define R_FRSTR     15
  90. #define R_FRIMG     16
  91.         /* Window Attributes */
  92. #define NAME        0x0001
  93. #define CLOSER        0x0002
  94. #define FULLER        0x0004
  95. #define MOVER        0x0008
  96. #define INFO        0x0010
  97. #define SIZER        0x0020
  98. #define UPARROW     0x0040
  99. #define DNARROW     0x0080
  100. #define VSLIDE        0x0100
  101. #define LFARROW     0x0200
  102. #define RTARROW     0x0400
  103. #define HSLIDE        0x0800
  104.         /* wind_create flags */
  105. #define WC_BORDER    0
  106. #define WC_WORK     1
  107.         /* wind_get flags */
  108. #define WF_KIND     1
  109. #define WF_NAME     2
  110. #define WF_INFO     3
  111. #define WF_WORKXYWH     4
  112. #define WF_CURRXYWH     5
  113. #define WF_PREVXYWH     6
  114. #define WF_FULLXYWH     7
  115. #define WF_HSLIDE    8
  116. #define WF_VSLIDE    9
  117. #define WF_TOP        10
  118. #define WF_FIRSTXYWH    11
  119. #define WF_NEXTXYWH     12
  120. #define WF_RESVD    13
  121. #define WF_NEWDESK    14
  122. #define WF_HSLSIZE    15
  123. #define WF_VSLSIZE    16
  124. #define WF_SCREEN    17
  125. #define WF_COLOR    18
  126. #define WF_DCOLOR    19
  127.         /* window elements    */
  128. #define W_BOX        0
  129. #define W_TITLE     1
  130. #define W_CLOSER    2
  131. #define W_NAME        3
  132. #define W_FULLER    4
  133. #define W_INFO        5
  134. #define W_DATA        6
  135. #define W_WORK        7
  136. #define W_SIZER     8
  137. #define W_VBAR        9
  138. #define W_UPARROW    10
  139. #define W_DNARROW    11
  140. #define W_VSLIDE    12
  141. #define W_VELEV     13
  142. #define W_HBAR        14
  143. #define W_LFARROW    15
  144. #define W_RTARROW    16
  145. #define W_HSLIDE    17
  146. #define W_HELEV     18
  147.         /* arrow message    */
  148. #define WA_UPPAGE    0
  149. #define WA_DNPAGE    1
  150. #define WA_UPLINE    2
  151. #define WA_DNLINE    3
  152. #define WA_LFPAGE    4
  153. #define WA_RTPAGE    5
  154. #define WA_LFLINE    6
  155. #define WA_RTLINE    7
  156.  
  157.         /* wind_update flags */
  158. #define END_UPDATE    0
  159. #define BEG_UPDATE    1
  160. #define END_MCTRL    2
  161. #define BEG_MCTRL    3
  162.         /* graf_mouse mouse types*/
  163. #define ARROW        0
  164. #define BEE     2
  165. #define BUSY_BEE    BEE     /* alias */
  166. #define TEXT_CRSR    1
  167. #define HOURGLASS    2
  168. #define POINT_HAND    3
  169. #define FLAT_HAND    4
  170. #define THIN_CROSS    5
  171. #define THICK_CROSS 6
  172. #define OUTLN_CROSS     7
  173. #define USER_DEF    255
  174. #define M_OFF        256
  175. #define M_ON        257
  176.         /* objects - general */
  177. #define ROOT 0                /* index of ROOT            */
  178. #define MAX_LEN     81        /* max string length        */
  179. #define MAX_DEPTH    8        /* max depth of search or draw    */
  180.         /* inside fill patterns */
  181. #define IP_HOLLOW    0
  182. #define IP_1PATT    1
  183. #define IP_2PATT    2
  184. #define IP_3PATT    3
  185. #define IP_4PATT    4
  186. #define IP_5PATT    5
  187. #define IP_6PATT    6
  188. #define IP_SOLID    7
  189.         /* normal graphics drawing modes */
  190. #define MD_REPLACE    1
  191. #define MD_TRANS    2
  192. #define MD_XOR        3
  193. #define MD_ERASE    4
  194.  
  195.         /* bit blt rules */
  196. #define ALL_WHITE    0
  197. #define S_AND_D     1
  198. #define S_AND_NOTD    2
  199. #define S_ONLY        3
  200. #define NOTS_AND_D    4
  201. #define D_ONLY        5
  202. #define S_XOR_D     6
  203. #define S_OR_D        7
  204. #define NOT_SORD    8
  205. #define NOT_SXORD    9
  206. #define D_INVERT    10
  207. #define NOT_D        10
  208. #define S_OR_NOTD    11
  209. #define NOT_S        12
  210. #define NOTS_OR_D    13
  211. #define NOT_SANDD    14
  212. #define ALL_BLACK    15
  213.  
  214.         /* font types */
  215. #define IBM 3
  216. #define SMALL 5
  217.  
  218.         /* object types */
  219. #define G_BOX        20
  220. #define G_TEXT        21
  221. #define G_BOXTEXT    22
  222. #define G_IMAGE     23
  223. #define G_USERDEF    24
  224. #define G_IBOX        25
  225. #define G_BUTTON    26
  226. #define G_BOXCHAR    27
  227. #define G_STRING    28
  228. #define G_FTEXT     29
  229. #define G_FBOXTEXT    30
  230. #define G_ICON        31
  231. #define G_TITLE     32
  232.         /* object flags */
  233. #define NONE        0x0000
  234. #define SELECTABLE    0x0001
  235. #define DEFAULT     0x0002
  236. #define EXIT        0x0004
  237. #define EDITABLE    0x0008
  238. #define RBUTTON     0x0010
  239. #define LASTOB        0x0020
  240. #define TOUCHEXIT    0x0040
  241. #define HIDETREE    0x0080
  242. #define INDIRECT    0x0100
  243. #define SUBMENU         0x0800            /* falcon aes hierarchical menus */
  244.         /* Object states */
  245. #define NORMAL        0x0000
  246. #define SELECTED    0x0001
  247. #define CROSSED     0x0002
  248. #define CHECKED     0x0004
  249. #define DISABLED    0x0008
  250. #define OUTLINED    0x0010
  251. #define SHADOWED    0x0020
  252.         /* Object colors - default pall. */
  253. #define WHITE     0
  254. #define BLACK     1
  255. #define RED      2
  256. #define GREEN     3
  257. #define BLUE     4
  258. #define CYAN     5
  259. #define YELLOW     6
  260. #define MAGENTA  7
  261. #define LWHITE     8
  262. #define LBLACK     9
  263. #define LRED     10
  264. #define LGREEN     11
  265. #define LBLUE     12
  266. #define LCYAN     13
  267. #define LYELLOW  14
  268. #define LMAGENTA 15
  269.         /* editable text field definitions */
  270. #define EDSTART     0
  271. #define EDINIT        1
  272. #define EDCHAR        2
  273. #define EDEND        3
  274.         /* editable text justification */
  275. #define TE_LEFT     0
  276. #define TE_RIGHT    1
  277. #define TE_CNTR     2
  278.  
  279.         /* file attr for dos_create */
  280. #define F_ATTR        0
  281.  
  282.         /* VDI Memory Form Definition Block */
  283.  
  284. #ifndef __MFDB__
  285. #ifndef _ALT_MFDB
  286. #ifndef __ALT_MFDB__
  287.  
  288. #define __MFDB__
  289.  
  290. typedef struct
  291. {
  292. #ifdef __TCC_COMPAT__
  293.     void        *fd_addr;
  294. #else /* !__TCC_COMPAT__ */
  295.     long        fd_addr;    /* Addrerss of upper left corner of first*/
  296.                                     /* plane of raster area. If NULL then    */
  297.                                     /* MFDB is for a physical device        */
  298. #endif /* !__TCC_COMPAT__ */
  299.     short        fd_w;        /* Form Width in Pixels                 */
  300.     short        fd_h;        /* Form Height in Pixels                */
  301.     short        fd_wdwidth; /* Form Width in shorts(fd_w/sizeof(int)*/
  302.     short        fd_stand;    /* Form format 0= device spec 1=standard*/
  303.     short        fd_nplanes; /* Number of memory planes                */
  304.     short        fd_r1;        /* Reserved                             */
  305.     short        fd_r2;        /* Reserved                             */
  306.     short        fd_r3;        /* Reserved                             */
  307. } MFDB;
  308. #endif
  309. #endif
  310. #endif    /* __MFDB__ */
  311.  
  312. #ifdef __ALT_MFDB__
  313. /* some software seems to wants this format for FDB. to get it, define
  314.    __ALT_MFDB__
  315.  */
  316. #ifdef __MFDB__
  317. # error conflicting types for MFDB
  318. #endif
  319.  
  320. #define __MFDB__
  321. typedef struct
  322. {
  323.     long    mp;
  324.     short    fwp;
  325.     short    fh;
  326.     short    fww;
  327.     short    ff;
  328.     short    np;
  329.     short    r1;
  330.     short    r2;
  331.     short    r3;
  332. } MFDB;
  333. #endif /* __ALT_MFDB__ */
  334.  
  335.         /* Mouse Form Definition Block */
  336. typedef struct mouse_form
  337.     {
  338.     short    mf_xhot;
  339.     short    mf_yhot;
  340.     short    mf_nplanes;
  341.     short    mf_bg;
  342.     short    mf_fg;
  343.     short    mf_mask[16];
  344.     short    mf_data[16];
  345.     } MFORM ;
  346.  
  347. typedef struct mouse_event_type
  348.     {
  349.     int *x;
  350.     int     *y;
  351.     int *b;
  352.     int *k;
  353.     } Mouse;
  354.  
  355. typedef struct graphic_rectangle
  356.     {    /* note these three rect structs are deliberately ints */
  357.     int g_x;
  358.     int g_y;
  359.     int g_w;
  360.     int g_h;
  361.     } GRECT;
  362.  
  363. typedef struct vdi_rectangle
  364.     {
  365.     int v_x1;
  366.     int v_y1;
  367.     int v_x2;
  368.     int v_y2;
  369.     } VRECT;
  370.  
  371. typedef struct orect
  372. {
  373.         struct orect    *o_link;
  374.     int o_x;
  375.     int o_y;
  376.     int o_w;
  377.     int o_h;
  378. } ORECT;
  379.  
  380. typedef struct rect_for_rect_utils
  381.     {    /* note these three rect structs are deliberately ints */
  382.     int x;
  383.     int y;
  384.     int w;
  385.     int h;
  386.     } Rect;
  387.  
  388. typedef struct text_edinfo
  389.     {
  390.     char *te_ptext;         /* ptr to text            */
  391.     char *te_ptmplt;        /* ptr to template            */
  392.     char *te_pvalid;        /* ptr to validation chrs.     */
  393.     short    te_font;        /* font                 */
  394.     short    te_junk1;        /* junk word                */
  395.     short    te_just;        /* justification            */
  396.     short    te_color;        /* color information word     */
  397.     short    te_junk2;        /* junk word                */
  398.     short    te_thickness;        /* border thickness         */
  399.     short    te_txtlen;        /* length of text string     */
  400.     short    te_tmplen;        /* length of template string */
  401.     } TEDINFO;
  402.  
  403. typedef struct icon_block
  404.     {
  405.     short    *ib_pmask;
  406.     short    *ib_pdata;
  407.     char    *ib_ptext;
  408.     short    ib_char;
  409.     short    ib_xchar;
  410.     short    ib_ychar;
  411.     short    ib_xicon;
  412.     short    ib_yicon;
  413.     short    ib_wicon;
  414.     short    ib_hicon;
  415.     short    ib_xtext;
  416.     short    ib_ytext;
  417.     short    ib_wtext;
  418.     short    ib_htext;
  419.         short    ib_resvd;
  420.     } ICONBLK;
  421.  
  422. typedef struct bit_block
  423.     {
  424.     char    *bi_pdata;            /* ptr to bit forms data  */
  425.     short    bi_wb;                /* width of form in bytes */
  426.     short    bi_hl;                /* height in lines */
  427.     short    bi_x;                /* source x in bit form  */
  428.     short    bi_y;                /* source y in bit form  */
  429.     short    bi_color;            /* fg color of blt */
  430.  
  431.     } BITBLK;
  432.  
  433. #ifndef __TCC_COMPAT__
  434. typedef struct object
  435.     {
  436.     short    ob_next;    /* -> object's next sibling       */
  437.     short    ob_head;    /* -> head of object's children       */
  438.     short    ob_tail;    /* -> tail of object's children       */
  439.     unsigned short ob_type; /* type of object              */
  440.     unsigned short ob_flags;/* flags                  */
  441.     unsigned short ob_state;/* state                  */
  442.     unsigned long  ob_spec; /* object-specific data           */
  443.     short    ob_x;        /* upper left corner of object          */
  444.     short    ob_y;        /* upper left corner of object          */
  445.     short    ob_width;    /* width of obj               */
  446.     short    ob_height;    /* height of obj              */
  447.     } OBJECT;
  448. #else
  449.  
  450. typedef struct {
  451.     unsigned int character     :    8;
  452.     signed     int framesize     :    8;
  453.     unsigned int framecol     :    4;
  454.     unsigned int textcol     :    4;
  455.     unsigned int textmode     :    1;
  456.     unsigned int fillpattern :    3;
  457.     unsigned int interiorcol :    4;
  458. } bfobspec;
  459.  
  460. struct user_block;    /* forward declaration */
  461.  
  462. typedef union __u_ob_spec {
  463.     TEDINFO     *tedinfo;
  464.     long        index;
  465.     char        *free_string;
  466.     union __u_ob_spec *indirect;
  467.         bfobspec    obspec;
  468.     BITBLK        *bitblk;
  469.     ICONBLK     *iconblk;
  470.     struct user_block *userblk;
  471. /*    APPLBLK     *applblk;
  472.     char        *string;    */
  473. } U_OB_SPEC;
  474.  
  475. typedef struct object
  476.     {
  477.     short    ob_next;    /* -> object's next sibling       */
  478.     short    ob_head;    /* -> head of object's children       */
  479.     short    ob_tail;    /* -> tail of object's children       */
  480.     unsigned short ob_type; /* type of object              */
  481.     unsigned short ob_flags;/* flags                  */
  482.     unsigned short ob_state;/* state                  */
  483.     U_OB_SPEC       ob_spec; /* object-specific data           */
  484.     short    ob_x;        /* upper left corner of object          */
  485.     short    ob_y;        /* upper left corner of object          */
  486.     short    ob_width;    /* width of obj               */
  487.     short    ob_height;    /* height of obj              */
  488.     } OBJECT;
  489. #endif
  490.  
  491. typedef struct parm_block
  492.     {
  493.     OBJECT    *pb_tree;
  494.     short    pb_obj;
  495.     short    pb_prevstate;
  496.     short    pb_currstate;
  497.     short    pb_x, pb_y, pb_w, pb_h;
  498.     short    pb_xc, pb_yc, pb_wc, pb_hc;
  499.     long    pb_parm;
  500.     } PARMBLK;
  501.  
  502. typedef struct user_block
  503.     {
  504. #ifdef __TCC_COMPAT__
  505.         int __CDECL (*ub_code)(PARMBLK *parmblock);
  506. #else
  507.         int __CDECL (*ub_code)(void *parmblock); /* really PARMBLK *parmblock */
  508. #endif
  509.     long ub_parm;
  510.     } USERBLK;
  511.  
  512.                         /* used in RSCREATE.C    */
  513. typedef struct rshdr
  514. {
  515.     short        rsh_vrsn;
  516.     unsigned short    rsh_object;
  517.     unsigned short    rsh_tedinfo;
  518.     unsigned short    rsh_iconblk;    /* list of ICONBLKS     */
  519.     unsigned short    rsh_bitblk;
  520.     unsigned short    rsh_frstr;
  521.     unsigned short    rsh_string;
  522.     unsigned short    rsh_imdata; /* image data            */
  523.     unsigned short    rsh_frimg;
  524.     unsigned short    rsh_trindex;
  525.     short        rsh_nobs;    /* counts of various structs    */
  526.     short        rsh_ntree;
  527.     short        rsh_nted;
  528.     short        rsh_nib;
  529.     short        rsh_nbb;
  530.     short        rsh_nstring;
  531.     short        rsh_nimages;
  532.     unsigned short    rsh_rssize; /* total bytes in resource    */
  533. } RSHDR;
  534.  
  535. #define DESKTOP_HANDLE 0
  536.  
  537. /* falcon aes menu_popup and menu_attach structure for passing and receiving
  538.  * submenu data.
  539.  */
  540.  
  541. typedef struct _menu
  542. {
  543.     OBJECT *mn_tree;    /* the object tree of the menu */
  544.     short    mn_menu;    /* the parent object of the menu items */
  545.     short    mn_item;    /* the starting menu item */
  546.     short    mn_scroll;    /* the scroll field status of the menu
  547.                            0  - The menu will not scroll
  548.                            !0 - The menu will scroll if the number of menu
  549.                                 items exceed the menu scroll height. The
  550.                 non-zero value is the object at which
  551.                 scrolling will begin.  This will allow one
  552.                 to have a menu in which the scrollable region
  553.                 is only a part of the whole menu.  The value
  554.                 must be a menu item in the menu.
  555.  
  556.                                 menu_settings can be used to change the menu
  557.                                 scroll height.
  558.  
  559.                          NOTE: If the scroll field status is !0, the menu
  560.                                items must consist entirely of G_STRINGS. */
  561.     short    mn_keystate; /* The CTRL, ALT, SHIFT Key state at the time the
  562.                 mouse button was pressed. */
  563. } MENU;
  564.  
  565. /* menu_settings uses a new structure for setting and inquiring the submenu
  566.  * delay values and the menu scroll height.  The delay values are measured in
  567.  * milliseconds and the height is based upon the number of menu items.
  568.  */
  569.  
  570. typedef struct _mn_set
  571. {
  572.     long Display;     /*  the submenu display delay       */
  573.     long Drag;         /*  the submenu drag delay        */
  574.     long Delay;      /*  the single-click scroll delay */
  575.     long Speed;      /*  the continuous scroll delay   */
  576.     short Height;     /*  the menu scroll height        */
  577. } MN_SET;
  578.  
  579. /* (user visible) binding arrays */
  580. extern short        _intin[], _intout[], _ptsin[], _ptsout[];
  581. #ifndef __GNUC__ /* for gcc see common.h in gemlib */
  582. extern void         *_addrin[], *_addrout[];
  583. #endif
  584. extern int        gl_apid, gl_ap_version;
  585.  
  586. #ifdef __cplusplus
  587. }
  588. #endif
  589.  
  590. #endif /* _GEMFAST_H */
  591.